import {request} from "./request";
//详情页数据请求
export function getDetail(iid){

  return request({
  url:'/detail',
  params:{
  iid,
  }
  })

}

// 推荐的数据
export function getRecommend(iid){

       return request({
         url:'/recommend',
         params:{
          iid,
          }
       })

}




// 详情页的商品数据(接口给的)，先将这部分数据整合成对象，构造函数
// 要用到数据的模块导入就行了，记得参数，
export class Goods{

   constructor(itemInfo,columns,services){
       this.title = itemInfo.title
       this.desc = itemInfo.desc
       this.newPrice = itemInfo.price
       this.oldPrice = itemInfo.oldPrice
       this.discount = itemInfo.discountDesc
       this.columns = columns
       this.services = services
       this.realPrice = itemInfo.lowNowPrice

   }
}

// 店铺信息构造函数
export class Shop{
  constructor(shopInfo){
    this.logo=shopInfo.shopLogo
    this.name=shopInfo.name
    this.fans=shopInfo.cFans
    this.sells=shopInfo.cSells
    this.goods=shopInfo.cGoods
    this.score=shopInfo.score
  }

}
